import { post } from '@/utils/request'

// 获取小程序绑定
export const getWechatAuthorizeUrl = p => post(`/openApi/v1/open/api/wxOpenEvent/getPreAuthUrl/${p}`, p)
// 查询或更新第三方授权信息 /openApi/v1/open/api/auth/queryOrUpdateOpenAuthInfo
export const queryOrUpdateOpenAuthInfo = p => post(`/openApi/v1/open/api/auth/queryOrUpdateOpenAuthInfo`, p)
// 查询授权权限列表信息 /openApi/v1/open/api/auth/queryWxOpenAuthFuncList/{appId}
export const queryWxOpenAuthFuncList = p => post(`/openApi/v1/open/api/auth/queryWxOpenAuthFuncList/${p}`, p)

// 公众号有效账号
export const checkVaildWxMp = p => post(`/service-msg/b/wxMp/v1/checkVaildWxMp`, p, 'post')
// 查询粉丝列表
export const listWxMpFans = p => post(`/service-msg/b/wxMp/fans/v1/pageList`, p)
// 同步粉丝
export const syncFansFromWx = p => post(`/service-msg/b/wxMp/fans/v1/syncFansFromWx/${p}`, p)
// 查询粉丝
export const viewWxMpFans = p => post(`/service-msg/b/wxMp/fans/v1/view/${p.appId}/${p.id}`, p)
// 修改备注
export const modifyWxMpFans = p => post(`/service-msg/b/wxMp/fans/v1/modify`, p)
// 用户打标签
export const wxMpFansAddTag = p => post(`/service-msg/b/wxMp/fansTags/v1/taggingFans`, p)
// 用户去标签
export const wxMpFansDelTag = p => post(`/service-msg/b/wxMp/fansTags/v1/removeFansTagsByTagsId`, p)

// 标签列表
export const getUserTagList = p => post(`/service-msg/b/wxMp/tags/v1/pageList`, p)
// 标签列表（不分页）
export const getUserTagAllList = p => post(`/service-msg/b/wxMp/tags/v1/list`, p)
// 新增标签
export const addUserTag = p => post(`/service-msg/b/wxMp/tags/v1/add`, p)
// 编辑标签
export const editUserTag = p => post(`/service-msg/b/wxMp/tags/v1/modify`, p)
// 删除标签
export const delUserTag = p => post(`/service-msg/b/wxMp/tags/v1/del/${p.id}`, p, 'get')
// 查询标签
export const searchUserTag = p => post(`/service-msg/b/wxMp/tags/v1/view/${p.id}`, p, 'get')
// 标签状态
export const changeUserTag = p => post(`/service-msg/b/wxMp/tags/v1/changeStatus/${p.id}/${p.status}`, p, 'get')

// 添加菜单
export const addWxMenu = p => post(`/service-msg/b/wxMp/menu/v1/add`, p)
// 修改菜单
export const editWxMenu = p => post(`/service-msg/b/wxMp/menu/v1/modify`, p)
// 删除菜单
export const delWxMenu = p => post(`/service-msg/b/wxMp/menu/v1/del/${p.id}`, p)
// 发布菜单
export const releaseWxMenu = p => post(`/service-msg/b/wxMp/menu/v1/release`, p)
// 查询菜单
export const searchWxMenu = p => post(`/service-msg/b/wxMp/menu/v1/menus`, p)
export const getList = p => post(`/service-msg/b/wxMp/menu/v1/queryMenu/${p.id}`, p, 'get')
export const saveAndRelease = p => post(`/service-msg/b/wxMp/menu/v1/saveAndReleasea`, p)
// 获取小程序列表
export const getMinList = p => post(`/service-msg/b/wxMp/applet/v1/list`, p)

// 消息管理
export const listWxMpMsg = p => post(`/service-msg/b/wxMp/msg/v1/pageList`, p)
// 消息管理
export const addWxMpMsg = p => post(`/service-msg/b/wxMp/msg/v1/add`, p)
// 消息管理
export const modifyWxMpMsg = p => post(`/service-msg/b/wxMp/msg/v1/modify`, p)
// 消息管理
export const viewWxMpMsg = p => post(`/service-msg/b/wxMp/msg/v1/view/${p}`, p)
// 消息管理
export const delWxMpMsg = p => post(`/service-msg/b/wxMp/msg/v1/del/${p}`, p)
// 消息管理查询
export const searchWxMpMsg = p => post(`/service-msg/b/wxMp/msg/v1/view/${p} `, p)

// 添加群发消息
export const addMassMessage = p => post(`/service-msg/b/wxMp/groupMsg/v1/add`, p)
// 删除群发消息
export const delMassMessage = p => post(`/service-msg/b/wxMp/groupMsg/v1/del/${p.id}`, p, 'get')
// 群发消息分页
export const listMassMessagePage = p => post(`/service-msg/b/wxMp/groupMsg/v1/pageList`, p)
// 群发消息查询
export const viewMassMessage = p => post(`/service-msg/b/wxMp/groupMsg/v1/view/${p.id}`, p, 'get')

// 公众号素材新增
export const addMediaSource = p => post(`/service-msg/b/wxMp/source/v1/add`, p)
// 公众号素材修改
export const modifyMediaSource = p => post(`/service-msg/b/wxMp/source/v1/modify`, p)
// 公众号素材列表
export const listMediaSource = p => post(`/service-msg/b/wxMp/source/v1/pageList`, p)
// 公众号素材查询
export const viewMediaSource = p => post(`/service-msg/b/wxMp/source/v1/view/${p.id}`, p, 'get')
// 公众号素材查询
export const viewMediaSourceByMediaId = p => post(`/service-msg/b/wxMp/source/v1/viewByMediaId/${p.mediaId}`, p, 'get')
// 公众号素材删除
export const delMediaSource = p => post(`/service-msg/b/wxMp/source/v1/del/${p.id}/${p.type}`, p, 'get')
// 素材同步微信
export const uploadMediaSource = p => post(`/service-msg/b/wxMp/source/v1/publish/${p.id}`, p, 'get')
// oss替换wx的地址
export const uploadImageTextMediaToWx = p => post(`/service-msg/b/wxMp/source/v1/uploadImageTextMediaToWx`, p)
// 公众号已发布素材
export const downloadPublishedVideoSource = p => post(`/service-msg/b/wxMp/source/v1/downloadPublishedVideoSource`, p)
// 公众号草稿箱素材
export const downloadDraftVideoSource = p => post(`/service-msg/b/wxMp/source/v1/downloadDraftVideoSource`, p)
// 同步微信公众号图片素材
export const syncMediaSourceFromWx = p => post(`/service-msg/b/wxMp/source/v1/syncMediaSourceFromWx/${p.type}`, p)

// 关键词回复新增
export const addAutoReplyMessage = p => post(`/service-msg/b/wxMp/autoReplyMsg/v1/add`, p)
// 关键词回复编辑
export const modifyAutoReplyMessage = p => post(`/service-msg/b/wxMp/autoReplyMsg/v1/modify`, p)
// 关键词回复删除
export const delAutoReplyMessage = p => post(`/service-msg/b/wxMp/autoReplyMsg/v1/del/${p.id}`, p, 'get')
// 关键词回复查询
export const viewAutoReplyMessage = p => post(`/service-msg/b/wxMp/autoReplyMsg/v1/view/${p.id}`, p, 'get')
// 关键词回复列表
export const listAutoReplyMessage = p => post(`/service-msg/b/wxMp/autoReplyMsg/v1/pageList`, p)
// 从微信同步自动消息
export const syncAutoReplayMessageFromWx = p => post(`/service-msg/b/wxMp/autoReplyMsg/v1/syncAutoReplayMessageFromWx/${p.type} `, p)
